<?php
namespace App\Models\PrizeType;

class PrizeTypeRepository implements \App\Contracts\Repositories\PrizeTypeRepository
{
    /**
     * @param PrizeType $prizeType
     * @return bool
     */
    public function create(PrizeType $prizeType)
    {
        return $prizeType->save();
    }

    /**
     * @return array
     */
    public function findList()
    {
        $newPrizeTypes = array();
        $prizeTypes = PrizeType::get();
        foreach ($prizeTypes as $prizeType) {
            $newPrizeTypes[$prizeType['code']] = $prizeType['name'];
        }
        return $newPrizeTypes;
    }
}
